package com.xh.bussiness.tools.service;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.xh.bussiness.course.model.Course;
import com.xh.bussiness.course.model.CourseIndex;
import com.xh.bussiness.course.service.ICourseIndexService;
import com.xh.bussiness.course.service.ICourseService;
import com.xh.bussiness.permission.bean.request.UserRequest;
import com.xh.bussiness.permission.model.Role;
import com.xh.bussiness.permission.model.School;
import com.xh.bussiness.permission.service.IRoleService;
import com.xh.bussiness.permission.service.IUserService;
import com.xh.bussiness.permission.util.UserAuthUtil;
import com.xh.bussiness.resource.model.Material;
import com.xh.bussiness.resource.model.MaterialCourseIndex;
import com.xh.bussiness.resource.model.MaterialPrepare;
import com.xh.bussiness.resource.service.IMaterialCourseIndexService;
import com.xh.bussiness.resource.service.IMaterialPrepareService;
import com.xh.bussiness.resource.service.IMaterialService;
import com.xh.bussiness.system.bean.dto.DictionaryBean;
import com.xh.bussiness.system.model.Dictionary;
import com.xh.bussiness.system.model.DictionaryRel;
import com.xh.bussiness.system.model.Group;
import com.xh.bussiness.system.model.GroupSubject;
import com.xh.bussiness.system.service.IDictionaryRelService;
import com.xh.bussiness.system.service.IDictionaryService;
import com.xh.bussiness.system.service.IGroupService;
import com.xh.bussiness.system.service.ISchoolService;
import com.xh.bussiness.tiku.bean.dto.QuestionDto;
import com.xh.bussiness.tiku.bean.request.QuestionSaveRequest;
import com.xh.bussiness.tiku.bean.request.SaveKnowledgeRequest;
import com.xh.bussiness.tiku.constant.QuestionConstant;
import com.xh.bussiness.tiku.dao.QuestionMapper;
import com.xh.bussiness.tiku.model.Paper;
import com.xh.bussiness.tiku.model.Question;
import com.xh.bussiness.tiku.model.QuestionSource;
import com.xh.bussiness.tiku.model.QuestionTypeRelation;
import com.xh.bussiness.tiku.service.IKnowledgeService;
import com.xh.bussiness.tiku.service.IPaperService;
import com.xh.bussiness.tiku.service.IQuestionService;
import com.xh.bussiness.tiku.service.IQuestionTypeRelationService;
import com.xh.bussiness.tools.constants.UrlConstants;
import com.xh.core.service.impl.BaseServiceImpl;
import com.xh.core.util.DateUtils;
import com.xh.core.util.HttpUtils;
import com.xh.core.util.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

@Service
public class DataHandleService extends BaseServiceImpl<QuestionMapper, Question> {


    @Autowired
    private IQuestionService questionService;


    public String handleSingleQuestionOptions() {
        QueryWrapper<Question> qw = new QueryWrapper<>();
        qw.eq("","");
        List<Question> wrongQuestions = questionService.queryByCondition(qw);

        return "成功修改题目数："+wrongQuestions.size();
    }
}
